package com.example.administrator.zyfypt410scl.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.example.administrator.zyfypt410scl.R;

public class LoginActivity extends AppCompatActivity implements View.OnClickListener{
    private TextView tv;
    private TextView et;
    private TextView wc;
    private EditText user;
    private EditText pass;
    private Button button1;
    private Button button2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        init();
    }

    private void init() {
        tv=(TextView)findViewById(R.id.textView);
        et =(TextView)findViewById(R.id.textView2);
        wc =(TextView)findViewById(R.id.textView6);
        user=(EditText)findViewById(R.id.editText6);
        pass=(EditText)findViewById(R.id.editText7);
        button1=(Button)findViewById(R.id.button);
        button2=(Button)findViewById(R.id.button2);
        button1.setOnClickListener(this);
        button2.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.button:
                Intent intent = new Intent(LoginActivity.this,MainActivity.class);
                startActivity(intent);
                break;
            case R.id.button2:
                Intent intent2 = new Intent(LoginActivity.this,RegisterActivity.class);
                startActivity(intent2);
                break;
            default:
                break;
        }
    }
}
